<?php
function nino_timeline_admin() {
	
	include('timeline-form.php');

	echo ob_get_clean();
}

function nino_timeline_admin_actions() {
	$page = add_menu_page('Nino Timeline', 'Nino Timeline', 'manage_options', 'nino_timeline_admin', 'nino_timeline_admin');
	
	add_action('admin_print_scripts-'.$page, 'nino_timeline_load_scripts');
}

function nino_timeline_load_scripts() {
	wp_enqueue_style('nino-timeline-style', plugin_dir_url( __FILE__ ) . 'assets/css/style.css');
	wp_enqueue_script(array('jquery','jquery-ui-core','jquery-ui-sortable'));
}

add_action('admin_menu', 'nino_timeline_admin_actions');

add_action('init', 'nino_timeline_do_output_buffer');
function nino_timeline_do_output_buffer() {
	ob_start();
}